package com.example.ruihuada.ui.HomeModule.adapter

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.ruihuada.R
import com.example.ruihuada.ui.HomeModule.activity.*
import com.example.util.ActivityToActivity


class ActivityAdapter(data: List<String>) :
    BaseQuickAdapter<String, BaseViewHolder>(R.layout.activity_list_item, data) {
    override fun convert(helper: BaseViewHolder, item: String?) {
        helper.setText(R.id.tv_activity_title, item)
        helper.setOnClickListener(R.id.tv_create, View.OnClickListener {
            when (helper.adapterPosition) {
                0 -> ActivityToActivity.toActivity(mContext, SecondKillActivity::class.java)
                1 -> ActivityToActivity.toActivity(mContext, AuditFailureActivity::class.java)
                2 -> ActivityToActivity.toActivity(mContext, RegistrationActivity::class.java)
                3 -> ActivityToActivity.toActivity(mContext, SignupActivity::class.java)
                4 -> ActivityToActivity.toActivity(mContext, ActivityDetailsActivity::class.java)
                5 -> ActivityToActivity.toActivity(mContext, EnrollmentActivity::class.java)
            }
        })
    }
}